﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;
using WORD = Microsoft.Office.Interop.Word;
using System.Windows.Xps.Packaging;
using Microsoft.Win32;
using System.IO;
using System.Xml;
using System.IO.Packaging;

namespace intelliSys.Management.Automation.Test
{
    public class AdvancedTextBox : TextBox
    {
        private string orignialText;
        private string displayedTextWhileOpenXMLEnabled;
        public string DisplayedTextWhileOpenXMLEnabled
        {
            get
            {
                if (!OpenXMLEnabled)
                {
                    throw new InvalidOperationException();
                }
                else
                {
                    return displayedTextWhileOpenXMLEnabled;
                }
            }
            set
            {
                if (!OpenXMLEnabled)
                {
                    throw new InvalidOperationException();
                }
                displayedTextWhileOpenXMLEnabled = value;
            }
        }
        public string OriginalText
        {
            get
            {
                return orignialText;
            }
            set
            {
                this.Text = OpenXMLEnabled ? "<OpenXML>" + this.displayedTextWhileOpenXMLEnabled + "</OpenXML>" : OriginalText;
                orignialText = value;
            }
        }
        public bool OpenXMLEnabled
        {
            get;
            set;
        }
    }
}
